<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul {
                list-style: none;
        }
        .wrap {
            width: 330px;
            height: 30px;
            margin: 100px auto;
            padding-left: 10px;
            background-image:url("imgs/bg.jpg") ;
        }
        li {
            background-image: url("imgs/libg.jpg");
        }
        .wrap>ul>li {
            float: left;
            margin-right: 10px;
            position: relative;
        }
        a {
            display: block;
            height: 30px;
            width: 100px;
            text-decoration: none;
            color: black;
            line-height: 30px;
            text-align: center;
        }
        li ul {
            position: absolute;
            top: 30px;
            display: none;
        }

    </style>

</head>
<body>
<div class="wrap">
    <ul>
        <li>
            <a href="javascript:void(0);">一级菜单1</a>
            <ul>
                <li><a href="javascript:void(0);">二级菜单1</a></li>
                <li><a href="javascript:void(0);">二级菜单2</a></li>
                <li><a href="javascript:void(0);">二级菜单3</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:void(0);">一级菜单1</a>
            <ul>
                <li><a href="javascript:void(0);">二级菜单1</a></li>
                <li><a href="javascript:void(0);">二级菜单2</a></li>
                <li><a href="javascript:void(0);">二级菜单3</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:void(0);">一级菜单1</a>
            <ul>
                <li><a href="javascript:void(0);">二级菜单1</a></li>
                <li><a href="javascript:void(0);">二级菜单2</a></li>
                <li><a href="javascript:void(0);">二级菜单3</a></li>
            </ul>
        </li>
    </ul>
</div>
<script src="../jquery-1.11.1.min.js"></script>
<script>
    $(document).ready(function () {
        var li = $('.wrap> ul > li');

        li.mouseenter(function () {
            $(this).children('ul').show();
        });
        li.mouseleave(function () {
            $(this).children('ul').hide();
        })
    });
</script>
</body>
</html>